package com.cwd.arm.domain.entity.base;

import com.cwd.arm.common.util.BigDecimalUtil;
import lombok.Data;

/**
 * Created by yan on 21-12-4.
 */
@Data
public class AmountTotalEntity {

    /**
     *
     */
    private Long id;

    /**
     *
     */
    private Integer fyYear;

    /**
     *
     */
    private Integer fyMonth;

    /**
     * 应收金额
     */
    protected java.math.BigDecimal receivableAmount;

    /**
     * 已收金额
     */
    protected java.math.BigDecimal receivedAmount;

    // TODO: 21-12-18
    /**
     * 节点已收金额
     */
    protected java.math.BigDecimal nodeReceivedAmount;

    /**
     * 确认收入金额
     */
    protected java.math.BigDecimal confirmAmount;

    /**
     * 期望支持
     */
    protected java.math.BigDecimal expectPayAmount;

    /**
     * 实际支出金额
     */
    protected java.math.BigDecimal actualPayAmount;


    public void calculate(AmountTotalEntity entity) {
        receivableAmount = BigDecimalUtil.add(receivableAmount, entity.getReceivableAmount());
        receivedAmount = BigDecimalUtil.add(receivedAmount, entity.getReceivedAmount());
        nodeReceivedAmount = BigDecimalUtil.add(nodeReceivedAmount, entity.getNodeReceivedAmount());
        confirmAmount = BigDecimalUtil.add(confirmAmount, entity.getConfirmAmount());
        expectPayAmount = BigDecimalUtil.add(expectPayAmount, entity.getExpectPayAmount());
        actualPayAmount = BigDecimalUtil.add(actualPayAmount, entity.getActualPayAmount());
    }

}
